Optimal. Leaf size=79 \[ \frac {b^3 \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{7/2} \sqrt {a+b}}+\frac {\left (a^2-a b+b^2\right ) \tan (x)}{a^3}+\frac {(2 a-b) \tan ^3(x)}{3 a^2}+\frac {\tan ^5(x)}{5 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3266, 472, 211}
\begin {gather*} \frac {b^3 \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{7/2} \sqrt {a+b}}+\frac {(2 a-b) \tan ^3(x)}{3 a^2}+\frac {\left (a^2-a b+b^2\right ) \tan (x)}{a^3}+\frac {\tan ^5(x)}{5 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 472
Rule 3266
Rubi steps
\begin {align*} \int \frac {\sec ^6(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {\left (1+x^2\right )^3}{x^6 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=-\text {Subst}\left (\int \left (\frac {1}{a x^6}+\frac {2 a-b}{a^2 x^4}+\frac {a^2-a b+b^2}{a^3 x^2}+\frac {b^3}{a^3 \left (-a-(a+b) x^2\right )}\right ) \, dx,x,\cot (x)\right )\\ &=\frac {\left (a^2-a b+b^2\right ) \tan (x)}{a^3}+\frac {(2 a-b) \tan ^3(x)}{3 a^2}+\frac {\tan ^5(x)}{5 a}-\frac {b^3 \text {Subst}\left (\int \frac {1}{-a-(a+b) x^2} \, dx,x,\cot (x)\right )}{a^3}\\ &=\frac {b^3 \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{7/2} \sqrt {a+b}}+\frac {\left (a^2-a b+b^2\right ) \tan (x)}{a^3}+\frac {(2 a-b) \tan ^3(x)}{3 a^2}+\frac {\tan ^5(x)}{5 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 80, normalized size = 1.01 \begin {gather*} -\frac {b^3 \text {ArcTan}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{a^{7/2} \sqrt {a+b}}+\frac {\left (8 a^2-10 a b+15 b^2+a (4 a-5 b) \sec ^2(x)+3 a^2 \sec ^4(x)\right ) \tan (x)}{15 a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 78, normalized size = 0.99
method | result | size |
default | \(\frac {\frac {\left (\tan ^{5}\left (x \right )\right ) a^{2}}{5}+\frac {2 a^{2} \left (\tan ^{3}\left (x \right )\right )}{3}-\frac {a b \left (\tan ^{3}\left (x \right )\right )}{3}+a^{2} \tan \left (x \right )-a b \tan \left (x \right )+b^{2} \tan \left (x \right )}{a^{3}}-\frac {b^{3} \arctan \left (\frac {a \tan \left (x \right )}{\sqrt {\left (a +b \right ) a}}\right )}{a^{3} \sqrt {\left (a +b \right ) a}}\) | \(78\) |
risch | \(\frac {2 i \left (15 b^{2} {\mathrm e}^{8 i x}-30 a b \,{\mathrm e}^{6 i x}+60 b^{2} {\mathrm e}^{6 i x}+80 a^{2} {\mathrm e}^{4 i x}-70 a b \,{\mathrm e}^{4 i x}+90 b^{2} {\mathrm e}^{4 i x}+40 a^{2} {\mathrm e}^{2 i x}-50 b \,{\mathrm e}^{2 i x} a +60 b^{2} {\mathrm e}^{2 i x}+8 a^{2}-10 a b +15 b^{2}\right )}{15 a^{3} \left ({\mathrm e}^{2 i x}+1\right )^{5}}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i x}+\frac {-2 i a^{2}-2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, a^{3}}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, a^{3}}\) | \(287\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 74, normalized size = 0.94 \begin {gather*} -\frac {b^{3} \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} a^{3}} + \frac {3 \, a^{2} \tan \left (x\right )^{5} + 5 \, {\left (2 \, a^{2} - a b\right )} \tan \left (x\right )^{3} + 15 \, {\left (a^{2} - a b + b^{2}\right )} \tan \left (x\right )}{15 \, a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 142 vs.
\(2 (67) = 134\).
time = 0.48, size = 348, normalized size = 4.41 \begin {gather*} \left [-\frac {15 \, \sqrt {-a^{2} - a b} b^{3} \cos \left (x\right )^{5} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} - 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt {-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) - 4 \, {\left ({\left (8 \, a^{4} - 2 \, a^{3} b + 5 \, a^{2} b^{2} + 15 \, a b^{3}\right )} \cos \left (x\right )^{4} + 3 \, a^{4} + 3 \, a^{3} b + {\left (4 \, a^{4} - a^{3} b - 5 \, a^{2} b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{60 \, {\left (a^{5} + a^{4} b\right )} \cos \left (x\right )^{5}}, \frac {15 \, \sqrt {a^{2} + a b} b^{3} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt {a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \cos \left (x\right )^{5} + 2 \, {\left ({\left (8 \, a^{4} - 2 \, a^{3} b + 5 \, a^{2} b^{2} + 15 \, a b^{3}\right )} \cos \left (x\right )^{4} + 3 \, a^{4} + 3 \, a^{3} b + {\left (4 \, a^{4} - a^{3} b - 5 \, a^{2} b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{30 \, {\left (a^{5} + a^{4} b\right )} \cos \left (x\right )^{5}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{6}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 104, normalized size = 1.32 \begin {gather*} -\frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} b^{3}}{\sqrt {a^{2} + a b} a^{3}} + \frac {3 \, a^{4} \tan \left (x\right )^{5} + 10 \, a^{4} \tan \left (x\right )^{3} - 5 \, a^{3} b \tan \left (x\right )^{3} + 15 \, a^{4} \tan \left (x\right ) - 15 \, a^{3} b \tan \left (x\right ) + 15 \, a^{2} b^{2} \tan \left (x\right )}{15 \, a^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.30, size = 84, normalized size = 1.06 \begin {gather*} \frac {{\mathrm {tan}\left (x\right )}^5}{5\,a}-{\mathrm {tan}\left (x\right )}^3\,\left (\frac {a+b}{3\,a^2}-\frac {1}{a}\right )+\mathrm {tan}\left (x\right )\,\left (\frac {3}{a}+\frac {\left (a+b\right )\,\left (\frac {a+b}{a^2}-\frac {3}{a}\right )}{a}\right )-\frac {b^3\,\mathrm {atan}\left (\frac {\sqrt {a}\,\mathrm {tan}\left (x\right )}{\sqrt {a+b}}\right )}{a^{7/2}\,\sqrt {a+b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________